package com.hkycu.goodsseckill;

public class Solution {
    public static void main(String[] args){
        int[] arr1 = new Solution().smallerNumbersThanCurrent(new int[]{7,7,7,7});
        for (int i=0;i < arr1.length;i++){
            System.out.println(arr1[i]);
        }
    }
    public int[] smallerNumbersThanCurrent(int[] nums) {
        int[] arr = new int[nums.length];
        for (int i = 0;i < nums.length;i++){
            int count = 0;
           // System.out.println(nums[i]);
            int temp = nums[i];
            for (int j = 0;j < nums.length;j++){
                if ( i == j){
                    continue;
                }
                if(temp>nums[j]){
                    count++;
                }
            }

            arr[i] = count;
        }
        return arr;
    }

}
